﻿using AutomaticPush;
using AutomaticPush.Common;
using AutomaticPush.Models;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace AutoPushExt.BLL
{
    public class BaseBLL
    {
        public WebApiExt _webApiExt
        { 
            get
            { 
                return Program.Provider.GetRequiredService<WebApiExt>();
            }
        }
        private IServiceScope ss;
        /// <summary>
        /// 配置文件
        /// </summary>
        public Configs configs
        {
            get
            {
                ss = Program.Provider.CreateScope(); 
                return ss.ServiceProvider.GetRequiredService<IOptionsMonitor<Configs>>().CurrentValue;
            }
        }
    }
}
